<%@ page contentType="text/html; charset=utf-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
<%@ taglib prefix="display" uri="http://displaytag.sf.net" %>

<html>
    <head>
        <title>OSDiary</title>
        <link href="css/default.css" rel="stylesheet" type="text/css" />
        <meta content="text/html; charset=utf-8" http-equiv="content-type">
        <script src="js/prototype.js" type="text/javascript"></script>
        <sx:head />
    </head>
    <body>
        <script language="javascript">
            <!--
            function emailExists(){
                var email = $('email').getValue();
                new Ajax.Request('mailexists.action',{
                    method: 'get',
                    parameters: 'email='+email,
                    onSuccess: function(transport){
                        var div = $('resultDiv');
                        if(transport.responseText.match(/true/))
                            div.innerHTML = "<img src=\"images/green.PNG\"/>";
                        else
                            div.innerHTML = "<img src=\"images/red.PNG\"/>";
                    }
                });
            }
            -->
        </script>

        <jsp:include page="WEB-INF/jspparts/logo.jsp" />

        <div id="content">

            <jsp:include page="WEB-INF/jspparts/sidebar.jsp" />

            <div id="main">
                <div id="welcome" class="post">

                    <s:form action="saveRepairedPassword" method="post" theme="simple">
                        <table>
                            <tr>
                                <td><s:property value="%{getText('email')}"/></td>
                                <td><s:textfield id="email" name="email" onkeyup="emailExists()"/></td>
                                <td><div id="resultDiv" width="15px" height="15px"><img src="images/red.PNG" /></div><td>
                            </tr>
                            <tr>
                                <td></td>
                                <td><s:submit value="%{getText('sendNewPassword')}" /></td>
                            </tr>
                        </table>
                    </s:form>
                </div>
            </div>
            <div id="extra" style="clear: both;"></div>
        </div>

        <jsp:include page="WEB-INF/jspparts/footer.jsp" />

    </body>
</html>